package com.css.resoft.p2pmonitor.entity;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the month_report database table.
 * 
 */
@Embeddable
public class MonthReportPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="p2p_code")
	private String p2pCode;

	@Column(name="year_and_month")
	private int yearAndMonth;

	public MonthReportPK() {
	}
	public String getP2pCode() {
		return this.p2pCode;
	}
	public void setP2pCode(String p2pCode) {
		this.p2pCode = p2pCode;
	}
	public int getYearAndMonth() {
		return this.yearAndMonth;
	}
	public void setYearAndMonth(int yearAndMonth) {
		this.yearAndMonth = yearAndMonth;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof MonthReportPK)) {
			return false;
		}
		MonthReportPK castOther = (MonthReportPK)other;
		return 
			this.p2pCode.equals(castOther.p2pCode)
			&& (this.yearAndMonth == castOther.yearAndMonth);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.p2pCode.hashCode();
		hash = hash * prime + this.yearAndMonth;
		
		return hash;
	}
}